/**
 * Created by wuli等等 on 2017/3/1.
 */
import React, { Component } from 'react';
import {
    StyleSheet,
    Text,
    View,
    TouchableNativeFeedback
} from 'react-native';
import Icon from 'react-native-vector-icons/FontAwesome';

export default class ToMore extends Component {

    _pressTo = () => {
        const { component } = this.props;
        const { navigator } = this.props; //解构
        //为什么这里可以取得 props.navigator?请看上文:
        //<Component {...route.params} navigator={navigator} />
        //这里传递了navigator作为props
        if(navigator) {
            navigator.push({
                component:component,
            })
        }
    };
    render() {

        return (
                <TouchableNativeFeedback  onPress={this._pressTo} >
                    <View style={styles.myIcon}>
                        <Icon name="chevron-right" size={18} color="#C7C7C7"/>
                    </View>
                </TouchableNativeFeedback>
        );
    }
}

const styles = StyleSheet.create({
    myIcon:{
        flex:1,
        justifyContent: 'center'
    },
});
